<?php
/**
 * Created by PhpStorm.
 * User: tangchao
 * Date: 19-4-19
 * Time: 下午2:57
 */

//堆 -- 提取

$heap = new SplMinHeap();

$heap->insert('data1');
$heap->insert('data2');

echo $heap->extract();
echo $heap->extract();


$maxheap = new SplMaxHeap();

$heap->insert('data3');
$heap->insert('data4');

echo $heap->extract();
echo $heap->extract();